package cn.handong.tool.沪房;

import org.junit.Test;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;

public class 消费日历 {

    private static final SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");

    @Test
    public void getConsumeCalendar(){
        int index = 0;
        for (int i = 3; i < 134; i++) {
            if (index == 7){
                index = 0;
                System.out.println();
                System.out.println("20"+"\t"+"20"+"\t"+"20"+"\t"+"20"+"\t"+"100"+"\t"+"0"+"\t"+"0");
            }
            String date = getDate(i);
            System.out.print(date);
            System.out.print("\t");
            index++;
        }

//        String date = getDate(25);
//        System.out.println(date);

//        BigDecimal v1 = BigDecimal.valueOf(System.currentTimeMillis());
//        BigDecimal v2 = BigDecimal.valueOf((long) 25 * 24 * 60 * 60 * 1000);
//        BigDecimal time = v1.add(v2);


//        Long v1 = System.currentTimeMillis();
//        Long v2 = (long) 25 * 24 * 60 * 60 * 1000;
//        Long time = v1 + v2;
//        String format = formatter.format(new Date(time));
//        System.out.println(format);
    }

    public String getDate(Integer days){
        Long v1 = System.currentTimeMillis();
        Long v2 = (long) days * 24 * 60 * 60 * 1000;
        Long time = v1 + v2;
        return formatter.format(new Date(time));
    }
}
